﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ERP_SalesPlanSelect.aspx.cs" Inherits="CRM_Manager_ERP_SalesPlanSelect" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JavaScript/Common.js"></script>
    <title></title>
    <script type="text/javascript" >


        function save() {
            var grid = gridPanel_listdata;
            if (!grid.hasSelection()) {
                Ext.Msg.alert("系统提示", "请选择一条记录!");
                return;
            }
            var record = grid.selModel.getSelected();
            var p = parent.Ext.getCmp('SalesPlanSelect');
            p.gobj(record.data.SalesPlanId);
            Closepopwin2('SalesPlanSelect');

        }
    </script>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled" />
    <form id="form1" runat="server">
    <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout" >
        <Content>
            <ext:Panel runat="server" Border="false" Layout="RowLayout">
                <Items>
                    <ext:FormPanel ID="searchForm" runat="server" Border="false" Padding="5" Height="118">
                        <Content>
                            <ext:FieldSet runat="server" Title="查询条件" Border="true" Layout="ColumnLayout" Header="true" Height="108">
                                <Items>
                                    <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.5">
                                        <Items>
                                            <ext:TextField runat="server" ID="exttextf_StoreRoomName" FieldLabel="申请库房" ReadOnly="true" AnchorHorizontal="0.95" />
                                            <ext:Hidden runat="server" ID="exthidn_StoreRoomID" />
                                            <ext:TextField runat="server" ID="exttxtf_SalesPlanNo" FieldLabel="销售计划单号" AnchorHorizontal="0.95" />
                                        </Items>
                                    </ext:Container>
                                    <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.5">
                                        <Items>
                                            <ext:TextField runat="server" ID="exttextf_Customer" FieldLabel="客户" ReadOnly="true" AnchorHorizontal="0.95" />
                                            <ext:Hidden runat="server" ID="exthidn_CustomerID" />
                                            <ext:CompositeField ID="CompositeField1" runat="server" AnchorHorizontal="0.95" FieldLabel="定制时间">
                                                <Items>
                                                    <ext:DateField ID="extdate_start" Vtype="daterange" runat="server" Flex="1" TabIndex="4">
                                                        <Listeners>
                                                            <Render Handler="this.endDateField = '#{extdate_end}'" />
                                                        </Listeners>
                                                    </ext:DateField>
                                                    <ext:Label ID="Label1" runat="server" Text="到" StyleSpec=" padding-top:3px;">
                                                    </ext:Label>
                                                    <ext:DateField ID="extdate_end" Vtype="daterange" runat="server" Flex="1" TabIndex="5">
                                                        <Listeners>
                                                            <Render Handler="this.startDateField = '#{extdate_start}'" />
                                                        </Listeners>
                                                    </ext:DateField>
                                                </Items>
                                            </ext:CompositeField>
                                                    <ext:Panel ID="Panel2" runat="server" Height="25" AnchorHorizontal="0.95" Border="false" ButtonAlign="Right">
                                                        <Content>
                                                            <table width="100%" >
                                                                <tr >
                                                                    <td style="width:33%" ></td>
                                                                    <td align="center" style="width:33%" >
                                                                        <ext:Button ID="extBtn_Search" runat="server" Text="查询" Icon="Find">
                                                                            <Listeners>
                                                                                <Click Handler="gridPanel_listdata.reload();" />
                                                                            </Listeners>
                                                                        </ext:Button>
                                                                    </td>
                                                                    <td align="center" style="width:33%" >
                                                                        <ext:Button ID="extBtn_Clear" runat="server" Text="清空" Icon="BasketDelete">
                                                                            <Listeners>
                                                                                <Click Handler="searchForm.reset();" />
                                                                            </Listeners>
                                                                        </ext:Button>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </Content>
                                                    </ext:Panel>
                                        </Items>
                                    </ext:Container>
                                </Items>
                            </ext:FieldSet>
                        </Content>
                    </ext:FormPanel>
                    <ext:GridPanel runat="server" ID="gridPanel_listdata" RowHeight="1" BodyStyle="border-width:1 0 0 0;" AutoScroll="true" TrackMouseOver="true" StripeRows="true">
                        <ColumnModel>
                            <Columns>
                                <ext:RowNumbererColumn Header="<center>序号</center>" Width="35" />
                                <ext:Column Header="<center>销售计划单号</center>" Width="180" DataIndex="SalesPlanNo" />
                                <ext:Column Header="<center>制定人</center>" Width="80" DataIndex="InUserName" />
                                <ext:DateColumn Header="<center>制定时间</center>" Width="125" DataIndex="InDate" Format="Y-m-d H:i:s" />
                                <ext:Column Header="<center>备注</center>" Width="150" DataIndex="Address" />
                            </Columns>
                        </ColumnModel>
                        <Store>
                            <ext:Store runat="server" ID="Store1" OnRefreshData="MyData_Refresh">
                                <Reader>
                                    <ext:JsonReader IDProperty="SalesPlanId">
                                        <Fields>
                                            <ext:RecordField Name="SalesPlanId" Type="Int" />
                                            <ext:RecordField Name="SalesPlanNo" />
                                            <ext:RecordField Name="StoreRoomId" Type="Int" />
                                            <ext:RecordField Name="StoreRoomName" />
                                            <ext:RecordField Name="CustomerId" Type="Int" />
                                            <ext:RecordField Name="CustomerName" />
                                            <ext:RecordField Name="InUser" />
                                            <ext:RecordField Name="InUserName" />
                                            <ext:RecordField Name="InDate" Type="Date" />
                                            <ext:RecordField Name="CheckUser" />
                                            <ext:RecordField Name="CheckDate" />
                                            <ext:RecordField Name="State" Type="Int" />
                                            <ext:RecordField Name="Remark" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                            </ext:Store>
                        </Store>
                        <SelectionModel>
                            <ext:CheckboxSelectionModel runat="server" SingleSelect="true" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar runat="server" ID="PagingToolbar1" PageSize="20" DisplayInfo="true"
                                Height="25" DisplayMsg="显示{0} - {1},共{2}条" EmptyMsg="没有可显示的记录" StateID="Store1" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
                <Buttons>
                    <ext:Button ID="Button1" runat="server" Text="取消" Icon="Cancel" OnClientClick="Closepopwin2('SalesPlanSelect');" />
                    <ext:Button ID="Button2" runat="server" Text="确定" Icon="Accept" OnClientClick="save();" />
                </Buttons>
            </ext:Panel>
        </Content>
    </ext:Viewport>
    </form>
</body>
</html>
